package com.guli.mall.pms.controller.frontWebController;

import com.guli.common.utils.R;

import com.guli.mall.pms.entity.vo.ItemDetailVo;
import com.guli.mall.pms.service.SkuInfoServiceForFrontPage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.ExecutionException;

/*
 * @Author 罗
 * @date 2020/10/17 - 9:56 上午
 */
@RestController
@RequestMapping("/item")
public class ItemController {

    @Resource
    SkuInfoServiceForFrontPage skuInfoServiceForFrontPage;

    @GetMapping("/getSkuDetailBySkuId/{skuId}")
    public R getSkuDetailBySkuId(@PathVariable("skuId")Long skuId) throws Throwable {

        ItemDetailVo itemDetailVo = skuInfoServiceForFrontPage.getAllSkuDetailBySkuId(skuId);

        return R.ok().put("data",itemDetailVo);
    }





}
